package com.ch.home.bean;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created by CHEN on 2019/8/27.
 */
public class DishAndSources {

    private Integer dishId;
    private String dishName;
    private String dishDescription;//菜品描述、介绍等
    private Integer dishRank;//推荐等级
    private String dishTag;//标签
    private Integer likeNum;//点赞数
    private String SourcePreviewUrl;
    private String url;
    private ArrayList<String> urls=new ArrayList<>();

    public DishAndSources() {
    }

    public DishAndSources(Integer dishId, String dishName, String dishDescription, Integer dishRank, String dishTag, Integer likeNum, String sourcePreviewUrl, String url, ArrayList<String> urls) {
        this.dishId = dishId;
        this.dishName = dishName;
        this.dishDescription = dishDescription;
        this.dishRank = dishRank;
        this.dishTag = dishTag;
        this.likeNum = likeNum;
        SourcePreviewUrl = sourcePreviewUrl;
        this.url = url;
        this.urls = urls;
    }

    public void addUrl(String url) {
        this.urls.add(url);
    }

    public Integer getDishId() {

        return dishId;
    }

    public void setDishId(Integer dishId) {
        this.dishId = dishId;
    }

    public String getDishName() {
        return dishName;
    }

    public void setDishName(String dishName) {
        this.dishName = dishName;
    }

    public String getDishDescription() {
        return dishDescription;
    }

    public void setDishDescription(String dishDescription) {
        this.dishDescription = dishDescription;
    }

    public Integer getDishRank() {
        return dishRank;
    }

    public void setDishRank(Integer dishRank) {
        this.dishRank = dishRank;
    }

    public String getDishTag() {
        return dishTag;
    }

    public void setDishTag(String dishTag) {
        this.dishTag = dishTag;
    }

    public Integer getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(Integer likeNum) {
        this.likeNum = likeNum;
    }

    public String getSourcePreviewUrl() {
        return SourcePreviewUrl;
    }

    public void setSourcePreviewUrl(String sourcePreviewUrl) {
        SourcePreviewUrl = sourcePreviewUrl;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public ArrayList<String> getUrls() {
        return urls;
    }

    public void setUrls(ArrayList<String> urls) {
        this.urls = urls;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        DishAndSources that = (DishAndSources) o;

        if (dishId != null ? !dishId.equals(that.dishId) : that.dishId != null) return false;
        if (dishName != null ? !dishName.equals(that.dishName) : that.dishName != null) return false;
        if (dishDescription != null ? !dishDescription.equals(that.dishDescription) : that.dishDescription != null)
            return false;
        if (dishRank != null ? !dishRank.equals(that.dishRank) : that.dishRank != null) return false;
        if (dishTag != null ? !dishTag.equals(that.dishTag) : that.dishTag != null) return false;
        if (likeNum != null ? !likeNum.equals(that.likeNum) : that.likeNum != null) return false;
        if (SourcePreviewUrl != null ? !SourcePreviewUrl.equals(that.SourcePreviewUrl) : that.SourcePreviewUrl != null)
            return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        return urls != null ? urls.equals(that.urls) : that.urls == null;
    }

    @Override
    public int hashCode() {
        int result = dishId != null ? dishId.hashCode( ) : 0;
        result = 31 * result + (dishName != null ? dishName.hashCode( ) : 0);
        result = 31 * result + (dishDescription != null ? dishDescription.hashCode( ) : 0);
        result = 31 * result + (dishRank != null ? dishRank.hashCode( ) : 0);
        result = 31 * result + (dishTag != null ? dishTag.hashCode( ) : 0);
        result = 31 * result + (likeNum != null ? likeNum.hashCode( ) : 0);
        result = 31 * result + (SourcePreviewUrl != null ? SourcePreviewUrl.hashCode( ) : 0);
        result = 31 * result + (url != null ? url.hashCode( ) : 0);
        result = 31 * result + (urls != null ? urls.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "DishAndSources{" +
                "dishId=" + dishId +
                ", dishName='" + dishName + '\'' +
                ", dishDescription='" + dishDescription + '\'' +
                ", dishRank=" + dishRank +
                ", dishTag='" + dishTag + '\'' +
                ", likeNum=" + likeNum +
                ", SourcePreviewUrl='" + SourcePreviewUrl + '\'' +
                ", url='" + url + '\'' +
                ", urls=" + urls +
                '}';
    }
}
